package com.AI.AIDemo.Demos.Web.Service.ServiceImpl;

import com.AI.AIDemo.Demos.Web.Config.OssConfig;
import com.AI.AIDemo.Demos.Web.Service.putObjectService;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import java.io.ByteArrayOutputStream;
import java.io.IOException;

/*
 * @Author:大力王
 * @Date:2025/4/24-24-23:17
 * 开始了
 */
@Service
public class putObjectServiceImpl implements putObjectService {

    @Resource
    private OssConfig ossConfig;
    @Override
    public String putObject(MultipartFile file, String fileType) throws IOException {
        return ossConfig.putObject(file, fileType);
    }

    @Override
    public ByteArrayOutputStream getObject(String objectName) throws IOException {
        return ossConfig.getObject(objectName);
    }
}
